import {reactive} from "vue";
import http from "../http";
const department = reactive({
    department_list: [],
    health_disease_List: [],
    current_category: 0,
    current_disease: 0,

    get_department_list(){
        // 获取科室信息列表
        return http.get(`/hospital/departmentList/`).then(response=>{
            this.department_list = response.data;
            console.log(response.data)
        })
    },
    get_health_disease () {
        // 获取大众健康-疾病分类信息
        return http.get(`/health/healthDisease/${this.current_category}/`,).then(response=>{
            console.log('大众健康-疾病分类信息请求成功..........');
            console.log(response);
            this.health_disease_List = response.data;
        }).catch((err) => {
            console.log('大众健康-疾病分类信息请求失败------');
            console.log(err);
        });
    },
    get_department_list_all(){
        // 获取科室信息列表
        return http.get(`/hospital/departmentListAll/`).then(response=>{
            this.department_list = response.data;
            console.log(response.data)
        })
    },

})

export default department;